﻿using System;
using System.Threading.Tasks;

namespace _051_带反回值的Task
{
    class Program
    {
        static void Main(string[] args)
        {
            var 计算 = Task.Run(() =>
            {
                long r = 1L;
                int t = 1;
                while (t <= 5)
                {
                    r = r * t;
                    t++;
                }
                return r;
            });

            计算.Wait();
            long 返回 = 计算.Result;

            Console.WriteLine($" 5的阶乘：{返回}");

        }
    }
}
